#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;

#define rep(i,n) for (int i=0; i<n; i++)

#define TRACE(x...) x 
#define PRINT(x...) TRACE(printf(x))

#define MULT_TEST(x...)  

int _42;
char str[210];
int l;
int ccont;
int fl;
int pcont;
int acont;
int a;

int main() {
	MULT_TEST(
		scanf("%d", &_42);

		while (_42--) {
	)
	
	scanf(" %s", str);

	l = strlen(str);
	fl=0;
	ccont=0;
	pcont=0;
	acont=0;

	rep(i,l) {
		if (str[i]=='@') {
			if (!ccont) {
				fl=1;
				break;
			}
			if (ccont==1) {
				if (pcont!=0) {
					fl=1;
					break;
				}	
			}

			ccont=0; pcont++; acont++;
		}
		else ccont++;
	}

	if (!ccont) fl=1;	
	if (!acont) fl=1;

	if (fl) {
		printf("No solution\n");
		MULT_TEST(continue;)
		return 0;
	}

	a=0;
	
	rep(i,l) {
		if (str[i]=='@') {
			i++; a++;
			printf("@%c", str[i]);
			if (a<acont) printf(",");	
		}
		else printf("%c", str[i]);
	}
	
	printf("\n");

	MULT_TEST( } )
	
	return 0;
}
